define(["jquery",
	"scprit/nutrition/app/nutritionApplication/addNutritionScheme.servers.js",
	"scprit/nutrition/app/nutritionApplication/addNutritionScheme.ui.js",
	"scprit/nutrition/app/nutritionApplication/addNutritionScheme.event.js"],
	function($,$servers,$ui,$event){
	var addNutritionScheme = {};

	var ajaxSchemeListCallBack = function(data){
		$ui.schemeInit({
			"id":"selectNutritionScheme",
			"list":data
		});
		$("#submit").unbind("click");
		$("#submit").click($event.onSubmit);
	}

	addNutritionScheme.init = function(){
		$servers.ajaxSchemeList(ajaxSchemeListCallBack);
		$("#search input").unbind("input propertychange");
		$("#search input").bind("input propertychange",$event.onSearchPatient);
		$("#search span").unbind("click");
		$("#search span").click($event.onEmptyClick);
	}

	return addNutritionScheme;
});